
//
//  ToRepairCell.m
//  PropertyMananger
//
//  Created by bh on 17/1/20.
//  Copyright © 2017年 BH. All rights reserved.
//

#import "ToRepairCell.h"

@implementation ToRepairCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *cellID = @"ToRepairCellID";
    ToRepairCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if(cell == nil) {
        cell = [[ToRepairCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    //选中cell的颜色 -无色
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return cell;
    
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{

    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
    
        self.toRepairButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.contentView addSubview:self.toRepairButton];
        [self.toRepairButton setTitle:@"去维修" forState:UIControlStateNormal];
        
        [self.toRepairButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        self.toRepairButton.titleLabel.font = BHFont(15);
        self.toRepairButton.backgroundColor = Theme_Color;
        self.toRepairButton.layer.cornerRadius = 5;
        self.toRepairButton.layer.masksToBounds = YES;
        
        [self.toRepairButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self).with.offset(30);
            make.centerY.equalTo(self).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(BHscreenW - 60, 40));
        }];
        
    }
    return self;
}
@end
